package com.lovo;

public class Test02 {
    public static void main(String[] args) {
//        String s = "hello" + " java " + " and " + "c++";
        String s1 = "hello";
//        String s2 = "hello";
//        String s3 = new String("hello");
//        String s4 = new String("hello");
//        System.out.println(s1 == s2);
//        System.out.println(s1 + " " + s2 + " " + s3);
//        System.out.println(s1 == s3);
//        System.out.println(s1.equals(s3));
        StringBuffer sb = new StringBuffer(s1);
        sb.append(" java");
        sb.append(" and");
        sb.append(" c++");
//        sb.delete(0,4);
//        sb.reverse();
        String str = sb.substring(0,5);
        System.out.println(str);
        System.out.println(sb);
    }
}
